import request from '@/utils/request';
import { getCache } from '@/utils/session';

/**
 * @description 查询列表
 */
export const remoteList = params => {
    
    let userInfo = getCache('userInfo') || { userId: '' };
    let { userId } = userInfo;
    return request.get('/sys/dept/queryDeptementByUserId', params ? params : { userId });
};

export const remoteDeptList = params=>{
    return request.get('/sys/dept/queryDeptement', params);
}

/**
 * 添加
 */
export const addInfo = data => {
    return request.post('/sys/dept/insert', data);
};

/**
 * 更新
 */
export const updateInfo = data => {
    return request.post('/sys/dept/update', data);
};

/**
 * 删除
 */
export const deleteInfo = data => {
    return request.post(`/sys/dept/delete`, data);
};

export default {
    remoteList
};
